package com.zyx.springretry.common.exception.base;


import com.zyx.springretry.common.constant.ResponseCode;

/**
 * <p>自定义异常基类
 *
 * @author Yaxi.Zhang
 * @since 2022/10/1 08:13
 */
public abstract class BaseException extends RuntimeException {

    private int code = ResponseCode.RESPONSE_CODE_200;

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public BaseException(int code, String message) {
        super(message);
        this.code = code;
    }

    public BaseException(String message) {
        super(message);
    }

    public BaseException(String message, Throwable cause) {
        super(message, cause);
    }

    public BaseException(Throwable cause) {
        super(cause);
    }

    public BaseException(String message, Throwable cause,
                         boolean enableSuppression,
                         boolean writableStackTrace) {
        super(message, cause, enableSuppression, writableStackTrace);
    }

}
